Hide verbose SSH connect output, add spinners#4694
Conversation
284aa8e to
9b4dc5d
Compare
Move detailed diagnostic messages (SSH key paths, secrets scope, remote user/port, job submission details, upload progress) from cmdio.LogString to log.Infof so they only appear with --log-level=info. Add spinners for long-running operations: binary upload, cluster state check, job startup wait, and metadata polling. Keep concise user-facing step messages (Connecting, Uploading, Starting, Connected) for progress visibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9b4dc5d to
f5a32d5
Compare
|
Commit: 6b48dad
18 interesting tests: 9 SKIP, 7 KNOWN, 1 flaky, 1 RECOVERED
Top 20 slowest tests (at least 2 minutes):
|
simonfaltum
left a comment
There was a problem hiding this comment.
[Agent Swarm Review] Verdict: Approved
- 0 Critical
- 0 Major
- 0 Gap
- 1 Nit
- 1 Suggestion
Good change. Moving diagnostic messages from cmdio.LogString to log.Infof and adding spinners for long-running operations improves the user experience. One nit on inconsistent spinner cleanup pattern.
| sp.Update("Uploading binaries...") | ||
| if err := UploadTunnelReleases(ctx, client, version, opts.ReleasesDir); err != nil { | ||
| sp.Close() | ||
| return fmt.Errorf("failed to upload ssh-tunnel binaries: %w", err) |
There was a problem hiding this comment.
[Agent Swarm Review] [Nit]
The spinner for binary upload creates and closes inline rather than using defer sp.Close(). An early return between sp := cmdio.NewSpinner(ctx) and sp.Close() would leak the spinner. The other spinners in this PR correctly use defer sp.Close().
Suggestion: Move sp.Close() to a defer and remove the explicit close calls.
There was a problem hiding this comment.
Fixed! Consolidated to a single sp.Close() call after UploadTunnelReleases returns (before checking the error). I didn't use defer here since the spinner should close before ensureSSHServerIsRunning which creates its own spinners. Also applied defer sp.Close() in ensureSSHServerIsRunning which had the same pattern.
| } | ||
|
|
||
| cmdio.LogString(ctx, fmt.Sprintf("Job submitted successfully with run ID: %d", waiter.RunId)) | ||
| log.Infof(ctx, "Job submitted successfully with run ID: %d", waiter.RunId) |
There was a problem hiding this comment.
Job run ID can be very useful for debugging (and cluster id too actually)
And the problem is that we can't really get them after the fact (unless we also store local logs to a file, which we don't do right now)
There was a problem hiding this comment.
Good point — changed this back to cmdio.LogString so the run ID is always visible to users.
- Use single sp.Close() after UploadTunnelReleases instead of duplicated calls - Use defer sp.Close() in ensureSSHServerIsRunning for consistent cleanup - Keep job run ID in cmdio.LogString so it's visible without --log-level=info Co-authored-by: Isaac
## Summary - Add `WithElapsedTime()` construction option to the spinner that shows a running `MM:SS` stopwatch as a prefix - The elapsed time is displayed as a prefix (e.g., `00:15 ⣾ Starting SSH server...`) so it stays pinned to the left as the message changes - Time starts at spinner construction — no separate method call needed - The elapsed time updates on every spinner tick (200ms) with no extra goroutines - Enable it for all SSH connect spinners (binary upload, cluster check, job startup, metadata polling) Stacked on #4694 ## Test plan - [x] Run `databricks ssh connect` and verify elapsed time appears as a prefix and ticks next to each spinner - [x] Verify other spinners in the codebase (without `WithElapsedTime()`) are unaffected - [x] Verify the time stays stable on the left as the spinner message changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
Commit: 9df759a
31 interesting tests: 16 RECOVERED, 9 KNOWN, 4 flaky, 1 FAIL, 1 SKIP
Top 50 slowest tests (at least 2 minutes):
|
Summary
cmdio.LogStringtolog.Infofso they only appear with--log-level=infoConnecting to <id>...,Uploading binaries...,Starting SSH server...,Connected!) for progress visibilitycmdio.LogString) since it's useful for debuggingResolves DECO-26523
Test plan
databricks ssh connectand verify only concise step messages + spinners are shown--log-level=infoand verify detailed messages appear🤖 Generated with Claude Code